#ifndef MAIL_H
#define MAIL_H

#include <string>
#include <list>

#include "rapidxml.hpp"

class Mail{
private :
	std::string* from;
	std::string* to;
	std::string* replyTo;
	std::string* subject;
	std::list<std::string*>* cc;
	std::string* body;

	Mail(const Mail&){}

public :
	Mail(void) : from(0), to(0), replyTo(0), subject(0), body(0) {
		cc = new std::list<std::string*>();
	}

	virtual ~Mail(void){
		cc->clear();
		delete(cc);
		delete(body);
	}
	
	std::string* getFrom(void) const { return from; }
	std::string* getTo(void) const { return to; }
	std::string* getReplyTo(void) const { return replyTo; }
	std::string* getSubject(void) const { return subject; }
	std::list<std::string*>* getCC(void) const { return cc; }
	std::string* getBody(void) const { return body; }

	void setFrom(std::string* _from){
		from = _from;
	}

	void setFrom(std::string _from){
		from = new std::string(_from);
	}

	void setTo(std::string* _to){
		to = _to;
	}

	void setTo(std::string _to){
		to = new std::string(_to);
	}

	void setReplyTo(std::string* _replyTo){
		replyTo = _replyTo;
	}

	void setReplyTo(std::string _replyTo){
		replyTo = new std::string(_replyTo);
	}

	void setSubject(std::string* _subject){
		subject = _subject;
	}

	void setSubject(std::string _subject){
		subject = new std::string(_subject);
	}

	void addCC(std::string* mail){
		cc->push_back(mail);
	}

	void addCC(std::string mail){
		cc->push_back(new std::string(mail));
	}

	void setBody(std::string* _body){
		body = _body;
	}

	void setBody(std::string _body){
		body = new std::string(_body);
	}
};

#endif //MAIL_H